package com.pudu.mydemo.utils;
import android.content.Context;
import android.widget.Toast;

/**
 * 封装的toast,只有一个对象toast
 */
public class ToastUtils {


	private static Toast  mToast;

	public static void showToast(Context context,CharSequence str,int duration)
	{
		if (mToast == null) {
			mToast = Toast.makeText(context, str, duration);
		}
		else {
			mToast.setText(str);
			mToast.setDuration(duration);
		}
		mToast.show();
		
	}
}
